// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) ansi 
// Source File Name:   HasRoleTag.java

package edu.whu.tao.tag;

import com.xiaoleilu.hutool.util.StrUtil;

import edu.whu.tao.util.AuthUtils;


public class HasRoleTag extends RoleTag {

	private static final String ROLE_NAMES_DELIMETER = ",";
	
	public HasRoleTag() {
	
	}

	protected boolean showTagBody(String roleName) {
		boolean hasAnyRole = false;
		if (StrUtil.isBlank(roleName))
			return true;
		String[] hasRoles = getRoles();
		if (hasRoles != null) {
			String permitRoles[] = StrUtil.split(roleName, ROLE_NAMES_DELIMETER);
			boolean isPermit = AuthUtils.isPermit(permitRoles, hasRoles);
			hasAnyRole = isPermit;
		}
		return hasAnyRole;
	}

	
}
